
import {render,connect} from '../../../../../hrpub/common/frame';
import BtnAction from '../../actions/btn.js'
import TempAction from '../../actions/temp.js'
import Pagination from '../../../../../hrpub/common/components/Pagination'


const RightTableDom = render({
    actions :{
        btnAction : BtnAction,
        tempAction : TempAction
    }
})(({props, action, state}) => {
    const {editTable,button,main} = props
    const {createEditTable} = editTable
    const {createButtonApp} = button
    return(
        <div>
            <div className = "header">
                <div className = "header-btn">
                    {createButtonApp({
                        area : 'list',
                        onButtonClick : action.btnAction.onButtonClick
                    })}
                </div>
            </div>
            <div className="table-area">
                {createEditTable('handitemgrid',{
                    showCheck : true,
                    onSelected : action.tempAction.onTableSelected,
                    onSelectedAll : action.tempAction.onTableonSelectedAll,
                    height: main.pageHeight
                })}
            </div>
            <div>
                {main.pageInfo.total ?<Pagination
                    total = {main.pageInfo.total}
                    pageSize = {main.pageInfo.pageSize}
                    showQuickJumper ={true}
                    showSizeChanger = {true}
                    onChange = {action.btnAction.paginationEve}
                    onShowSizeChange = {action.btnAction.pageSizeSelect}
                /> : null}
            </div>
        </div>         
    )
})

export default connect(RightTableDom)